class Solution:
    def maximumGap(self, nums) -> int:
        if len(nums) <= 1:
            return 0
        nums.sort()
        maxLen = nums[1] - nums[0]
        for i in range(1, len(nums) -1):
            maxLen = max(maxLen, nums[i+1] - nums[i])
        return maxLen

if __name__ == '__main__':
    so = Solution()
    s = [3,6,9,1]
    r = so.maximumGap(s)
    print(r)
